function [a,P] = DefaultStrategy(P,S,mode)

    B=S{1};
    still=0;
    
    B_X=B{1}(1);
    B_Y=B{1}(2);
    
    P_X=P{1}(1);
    P_Y=P{1}(2);
    P_theta=P{1}(3);
    P_color=P{2};
    P_num=P{3};
    
    dist=sqrt((B_X-P_X)^2+(B_Y-P_Y)^2);    % compute the distance to the ball
    
    if(~PlayerInPossession(P,S,mode))
        for k=2:numel(S) % check teammates
            if(S{k}{2} == P_color) % this you are seeing a teammate
                Sk=S{k};
                Sk_X=Sk{1}(1);
                Sk_Y=Sk{1}(2);
                
                dist2=sqrt((B_X-Sk_X)^2+(B_Y-Sk_Y)^2);    %compute the distance to the ball from that mate
                
                if(dist2 < dist) % mate is closer to the ball so choose get open
                    [a,P]=GetOpen(P,S,mode);
                    %if(P_color == 'b' && P_X-3 > B_X),[a,P]=GetOpen(P,S,mode);
                    %elseif(P_color == 'r' && P_X+3 < B_X),[a,P]=GetOpen(P,S,mode);
                    %else a='';
                    %end
                    still = 1;
                    break; % no need to go through the rest of the teammates
                else 
                    continue;
                end
            else
                break; % because you have seen all the teammates
            end
                 
        end
        
        if(~still) % if this player is closest to the ball, go for it
            [a, P] = GoToBall(P,S,mode);
        end    
    else % player is in possession
        close = 0;
        
        for l=2:numel(S) % check opponents
           if(S{l}{2} ~= P_color)
               Sl=S{l};
               Sl_X=Sl{1}(1);
               Sl_Y=Sl{1}(2);
               
               if(abs(Sl_X-P_X) + abs(Sl_Y-P_Y) <16 &&  abs(Sl_X-(-58)) < abs(P_X-(-58)) )    % close - do not dribble - dangerous
                   close=1;
                   if(P_color == 'b')
                        a = sprintf('kick %d %d',5,round(180+((-1)^(round(1+rand(1)*(2-1))))*(30+round(1+rand(1)*(45-1))))-P_theta);%round(45*rand(1)));
                   else
                        a = sprintf('kick %d %d',5,round(((-1)^(round(1+rand(1)*(2-1))))*(30+round(1+rand(1)*(45-1))))-P_theta);%round(45*rand(1)));
                   end
                   break;                   
               end
           end    
        end
        
        if(~close) % just dribble
            if(P_color == 'b')
                a=sprintf('kick %d %d',7,180+((-1)^(round(1+rand(1)*(2-1))))*round(rand(1)*15)-P_theta);    
            else
                a=sprintf('kick %d %d',7,((-1)^(round(1+rand(1)*(2-1))))*round(rand(1)*15)-P_theta);
            end
        end
    end            

end